﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace LitTools
{
    /// <summary>
    /// 2DTrigger观察
    /// </summary>
    [DisallowMultipleComponent]
    public class Trigger2DObserver : MonoBehaviour
    {
        public event Action<Collider2D> OnTrigger2DEnterAct;
        public event Action<Collider2D> OnTrigger2DStayAct;
        public event Action<Collider2D> OnTrigger2DExitAct;
        private void OnTriggerEnter2D(Collider2D collision)
        {
            OnTrigger2DEnterAct?.Invoke(collision);
        }

        private void OnTriggerStay2D(Collider2D collision)
        {
            OnTrigger2DStayAct?.Invoke(collision);
        }

        private void OnTriggerExit2D(Collider2D collision)
        {
            OnTrigger2DExitAct?.Invoke(collision);
        }
    }
}